home *** CD-ROM | disk | FTP | other *** search
- { *********************************************************************** }
- { }
- { Delphi / Kylix Cross-Platform Runtime Library }
- { System Initialization Unit }
- { }
- { Copyright (c) 1997-2001 Borland Software Corporation }
- { }
- { *********************************************************************** }
-
- unit SysInit;
-
- interface
-
- {$H+,I-,R-,S-,O+,W-}
- {$WARN SYMBOL_PLATFORM OFF}
-
- {$IFDEF LINUX}
- const
- ExeBaseAddress = Pointer($8048000) platform;
- {$ENDIF}
-
- var
- ModuleIsLib: Boolean; { True if this module is a dll (a library or a package) }
- ModuleIsPackage: Boolean; { True if this module is a package }
- ModuleIsCpp: Boolean; { True if this module is compiled using C++ Builder }
- TlsIndex: Integer; { Thread local storage index }
- TlsLast: Byte; { Set by linker so its offset is last in TLS segment }
- HInstance: LongWord; { Handle of this instance }
- {$EXTERNALSYM HInstance}
- (*$HPPEMIT 'namespace Sysinit' *)
- (*$HPPEMIT '{' *)
- (*$HPPEMIT 'extern PACKAGE HINSTANCE HInstance;' *)
- (*$HPPEMIT '} /* namespace Sysinit */' *)
- DllProc: TDLLProc; { Called whenever DLL entry point is called }
- { DllProcEx passes the Reserved param provided by WinNT on DLL load & exit }
- DllProcEx: TDLLProcEx absolute DllProc;
- DataMark: Integer = 0; { Used to find the virtual base of DATA seg }
- {$IFDEF ELF}
- TypeImportsTable: array [0..0] of Pointer platform; { VMT and RTTI imports table for exes }
- _GLOBAL_OFFSET_TABLE_: ARRAY [0..2] OF Cardinal platform;
- (* _DYNAMIC: ARRAY [0..0] OF Elf32_Dyn; *)
- {$IFDEF PC_MAPPED_EXCEPTIONS}
- TextStartAdj: Byte platform; { See GetTextStart }
- CodeSegSize: Byte platform; { See GetTextStart }
- function GetTextStart : LongInt; platform;
- {$ENDIF}
- {$ENDIF}
-
- function _GetTls: Pointer;
- {$IFDEF LINUX}
- procedure _InitLib(Context: PInitContext);
- procedure _GetCallerEIP;
- procedure _InitExe(InitTable: Pointer; Argc: Integer; Argp: Pointer);
- procedure _start; cdecl;
- function _ExitLib: Integer; cdecl;
- function _InitPkg: LongBool;
- {$ENDIF}
- {$IFDEF MSWINDOWS}
- procedure _InitLib;
- procedure _InitExe(InitTable: Pointer);
- function _InitPkg(Hinst: Integer; Reason: Integer; Resvd: Pointer): LongBool; stdcall;
- {$ENDIF}
- procedure _PackageLoad(const Table: PackageInfo);
- procedure _PackageUnload(const Table: PackageInfo);
-
- {$IFDEF MSWINDOWS}
- { Invoked by C++ startup code to allow initialization of VCL global vars }
- procedure VclInit(isDLL, isPkg: Boolean; hInst: LongInt; isGui: Boolean); cdecl;
- procedure VclExit; cdecl;
- {$ENDIF}
-
- implementation
-